from rest_framework import serializers
from trade.models import Agent, Trade
import time, random


class AgentSerializer(serializers.ModelSerializer):
    agentId = serializers.IntegerField(source='id')
    agentName = serializers.CharField(max_length=64, source='agent_name')

    class Meta:
        model = Agent
        fields = ["agentId", "agentName"]


# class TradesSerializer(serializers.ModelSerializer):
#     tradeId = serializers.IntegerField(source='id')
#     date = serializers.DateField()
#     equipment = serializers.CharField(max_length=16)
#     count = serializers.IntegerField()
#     collection = serializers.DecimalField(max_digits=8, decimal_places=2)
#     no_collection = serializers.DecimalField(max_digits=8, decimal_places=2)
#     profits = serializers.DecimalField(max_digits=8, decimal_places=2)
#
#
#     class Meta:
#         model = Trade
#         fields = ["agentId", "agentName"]

